function mcpart=Esqint2(pathnum)

intBMsq=zeros(51,1);
time=linspace(0,1/2,51)';
time2=linspace(0,1/2,5001);
for pn=1:pathnum
    disp(pn);
    [getOU,getBM]=correlatedou(1,1,1,1,5001);
    BMsq=getOU.*getBM;
%    BMsq=(getBM.^2).*(getOU.^2);   
%     for jj=1:51
%         intBMsq(jj)=intBMsq(jj)+BMsq((jj-1)*100+1);
%     end
    for jj=1:51
        intBMsq(jj)=intBMsq(jj)+midptrule(BMsq(1:(jj-1)*100+1),1/10000)^2;
    end
end
fname='case5_1';
mcpart=intBMsq/pathnum;
save(fname,'mcpart')